package cn.bm.web;

import cn.bm.web.controllers.RouteMain;

import static spark.Spark.*;

public class Main {
    public static void main(String[] args) {
        int n = 8090;
        port(n);
        staticFiles.location("/public");

        before("/*",(request, response) -> {
            response.header("Access-Control-Allow-Origin", "*");
            response.header("Cache-Control", "no-cache");
            response.header("Access-Control-Allow-Headers","*");
            response.header("Access-Control-Request-Method","*");
            response.type("text/html");
            request.raw().setCharacterEncoding("UTF-8");
        });


        // 初始化各route
        RouteMain.InitSiteRoutes();
    }
}